# 编译器和参数
CC = gcc
CFLAGS = -Wall -g
INCLUDES = -Iinclude

# 源文件和目标文件
MAIN_SRCS = src/main.c src/fs.c src/disk.c src/file_op.c src/sync.c
TEST_SRCS = src/main_test.c src/fs.c src/disk.c src/file_op.c src/sync.c

TARGET = simple_fs
TEST_TARGET = fs_test

# 默认目标
all: $(TARGET)

$(TARGET): $(MAIN_SRCS)
	$(CC) $(CFLAGS) $(INCLUDES) -o $(TARGET) $(MAIN_SRCS)

$(TEST_TARGET): $(TEST_SRCS)
	$(CC) $(CFLAGS) $(INCLUDES) -o $(TEST_TARGET) $(TEST_SRCS)

clean:
	rm -f $(TARGET) $(TEST_TARGET)

clean_all:
	rm -f $(TARGET) $(TEST_TARGET) disk.img